<!--
- Author:  LiShibin.
- Date:    2018/2/7 0007.
- File:    about.
-->
<template>
  <div class="tc"><img src="../../assets/images/ewm.jpg" style="width: 100%; height: 100%">
  <!--<div class="tc about"><img src="../../assets/images/huanlian.png" style="margin-top: 5rem; margin-bottom: 10px; width: 8rem; height: 8rem">-->
    <!--<p v-if="$deviceType == 'APICloud'">当前版本：v{{appVersion}}</p>-->
    <!--<p style="margin-top: 10px;">扫码可下载App</p>-->
    <!--<div class="Extension" v-show="$deviceType == 'APICloud'"><a @click="saveToAlbum">保存到相册</a><a @click="wxShare">分享</a></div>-->
    <!--<footer-tab></footer-tab>-->
    <!--<div class="pl20 pr20 mt35" style="position: fixed; bottom:  10px; width: 100%">-->
      <!--<button type="button" class="but_1 wauto" @click="$utils.back">返回</button>-->
    <!--</div>-->
  </div>
</template>

<script>

  export default{
    data() {
      return {
        appVersion: ''
      }
    },
    created() {
      if (this.$deviceType == 'APICloud') {
        this.appVersion = window.api.appVersion
      }
    },
    components: {},
    methods: {
      wxShare() {
        let _this = this
        let timestamp = _this.$utils.getTimestamp()
        window.api.download({
          url: _this.$config.website + '/wap/static/images/yshk-app.png',
          savePath: 'fs://yshk-app_' + timestamp + '.png',
          report: true,
          cache: true,
          allowResume: true
        }, function (ret, err) {
          if (ret.state == 1) {
            var wx = window.api.require('wx')
            wx.shareImage({
              apiKey: '',
              scene: 'session',
//          thumb: 'widget://a.jpg',
              contentUrl: 'fs://yshk-app_' + timestamp + '.png'
            }, function(ret, err) {
              if (ret.status) {
                _this.$toast('分享成功')
              } else {
                _this.$toast('分享失败:' + err.code)
              }
            })
          } else {
            _this.$toast('获取二维码失败', err.msg)
          }
        })
      },
      saveToAlbum() {
        let _this = this
        let timestamp = _this.$utils.getTimestamp()
        window.api.download({
          url: _this.$config.website + '/wap/static/images/yshk-app.png',
          savePath: 'fs://yshk-app_' + timestamp + '.png',
          report: true,
          cache: true,
          allowResume: true
        }, function (ret, err) {
          if (ret.state == 1) {
            window.api.saveMediaToAlbum({
              path: 'fs://yshk-app_' + timestamp + '.png'
            }, function (ret, err) {
              if (ret && ret.status) {
                _this.$toast('保存成功')
              } else {
                _this.$toast('保存失败:' + err.msg)
              }
            })
          } else {
            _this.$toast('下载二维码失败', err.msg)
          }
        })
      }
    }
  }
</script>

<style>

</style>
